<template>
  <div>
      <button @click="msg='你好'">修改msg</button>
      <p>app.vue里的p -- {{ msg }}</p>
      <p>{{ obj }}</p>
      <p>{{ arr }}</p>

      <!-- 
        把父里的msg给子要的sonMsg
        把父里的age给子要的age
       -->
      <son1 @changeMsg="fn" :sonMsg="msg" :age="age" :obj="obj" :list="arr"/>

      <son2 />
  </div>
</template>

<script>
import son1 from './components/son1'
import son2 from './components/son2'
export default {
  methods: {
    fn (data) {
      // console.log('收到！', data)
      this.msg = data
    }
  },
  // 注册组件
  components: {
    son1,
    son2
  },

  data() {
    return {
      msg: '马杀鸡',
      age: 16,
      obj: {
        name: 'jack',
        age: 16
      },

      arr: [10,20,30,40]
    }
  },
}
</script>

<style>

</style>